package com.infore.statisticsAndAlarm.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.infore.statisticsAndAlarm.service.IOperationDataService;
import com.infore.statisticsAndAlarm.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "宇星运营-站点运维管理接口", tags = { "宇星运营-站点运维管理接口" })
@RestController
@RequestMapping("/operaData")
public class OperationDataController {

	@Autowired
	private IOperationDataService iOperationDataService;
	
	@ApiOperation(value = "站点实时数据--不分类别 ",notes="站点实时数据--不分类别")
	@ApiImplicitParams({
		@ApiImplicitParam(value = "站点类型", name = "stationType", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "关键字", name = "key", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "站点mn,可多个", name = "stationMns", paramType = "query", required = false, dataType = "String"),
		@ApiImplicitParam(value = "分页参数", name = "pageNo", paramType = "query", required = false, dataType = "int"),
		@ApiImplicitParam(value = "分页参数", name = "pageSize", paramType = "query", required = false, dataType = "int")})
	@GetMapping(value = "/queryRealTime")
	public ResultEntity queryRealTime(String stationType,String key,String stationMns,
			Integer pageNo,Integer pageSize,HttpServletRequest request) {
		return iOperationDataService.queryRealTime(stationType,key,stationMns,pageNo,pageSize,request);
	}
	
	@ApiOperation(value = "站点实时数据--分类别 ",notes="站点实时数据--分类别")
	@ApiImplicitParams({
		@ApiImplicitParam(value = "站点类型", name = "stationType", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "关键字", name = "key", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "站点mn,可多个", name = "stationMns", paramType = "query", required = false, dataType = "String"),
		@ApiImplicitParam(value = "分页参数", name = "pageNo", paramType = "query", required = false, dataType = "int"),
		@ApiImplicitParam(value = "分页参数", name = "pageSize", paramType = "query", required = false, dataType = "int")})
	@GetMapping(value = "/queryRealTimeGroup")
	public ResultEntity queryRealTimeGroup(String stationType,String key,String stationMns,
			Integer pageNo,Integer pageSize,HttpServletRequest request) {
		return iOperationDataService.queryRealTimeGroup(stationType,key,stationMns,pageNo,pageSize,request);
	}
	
	@ApiOperation(value = "站点历史数据",notes="站点历史数据")
	@ApiImplicitParams({
		@ApiImplicitParam(value = "站点类型", name = "stationType", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "站点mn,可多个", name = "stationMns", paramType = "query", required = false, dataType = "String"),
		@ApiImplicitParam(value = "因子编码", name = "projectCode", paramType = "query", required = false, dataType = "String"),
		@ApiImplicitParam(value = "分页参数", name = "pageNo", paramType = "query", required = false, dataType = "int"),
		@ApiImplicitParam(value = "分页参数", name = "pageSize", paramType = "query", required = false, dataType = "int"),
		@ApiImplicitParam(value = "开始时间yyyy-MM-dd HH:mm:ss", name = "start", paramType = "query",required = false,dataType = "String"),
		@ApiImplicitParam(value = "结束时间yyyy-MM-dd HH:mm:ss", name = "end", paramType = "query", required = false, dataType = "String")})
	@GetMapping(value = "/queryHistory")
	public ResultEntity queryHistory(String stationType,String stationMns,
			Integer pageNo,Integer pageSize,HttpServletRequest request,String start,String end,String projectCode) {
		return iOperationDataService.queryHistory(stationType,stationMns,pageNo,pageSize,request,start,end,projectCode);
	}
	
}
